package cn.laixueit.mapper;

import cn.laixueit.pojo.Card;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface CardMapper {

    @Select("select * from card")
    public List<Card> findAll();


    @Select("select * from card where starttime > #{starttime} and endtime < #{endtime}")
    List<Card> find(Map map);


    @Select("select * from card where starttime > #{starttime} and endtime < #{endtime}")
    List<Card> find2(Map map);


    @Insert("insert into card(cardid) values(#{cardid})")
    @Options(keyProperty = "id",keyColumn = "id",useGeneratedKeys = true)
    public void save(Card card);
}
